import { Tag, Button } from 'antd';
import React, { Component } from 'react';

import ExtendsPureComponentFuncChild from './extendsPureComponentFuncChild';

class ExtendsComponent extends Component {

    state = {
        count: 1,
        show: 0
    }

    add = () => {
        const { count } = this.state;

        this.setState({
            count: count + 1
        })
    }

    render() {
        const { count, show } = this.state;

        // const renderAdd = () => {};

        return (
            <div>
                <Tag>更新展示数字：{count}</Tag>
                <br /><br />
                <Button type='primary' onClick={this.add}>点击更新父组件数字</Button>
                <br /><br />
                <ExtendsPureComponentFuncChild show={show} add={this.add} />

                {/* <ExtendsPureComponentFuncChild show={show} renderAdd={renderAdd} /> */}
            </div>
        )
    }
}

export default ExtendsComponent;